|
|
 |
|
|
|
|
Optional strSection As String = "NA", _
Optional strKeyName As String = "NA")
' Fill in properties
If strSection <> "NA" Then
mstrSection = strSection
End If
If strKeyName <> "NA" Then
mstrKeyName = strKeyName
End If
If strKeyValue <> "NA" Then
mstrKeyValue = strKeyValue
End If
SaveSetting mstrConfigName, _
mstrSection, _
mstrKeyName, _
mstrKeyValue
End Sub |
|
|
|
|
|
|
|
|
Using the Registry Class to Get a Section's Values |
|
|
|
|
|
|
|
|
Sometimes you might want to retrieve all the key names and key values from one section in the Registry. You can call the SectionGet() method in the Registry class to have it return a String array of all the KeyName=KeyValue pairs of data. If you click the Get All Values command button on the sample form, youll see the SectionGet() method in use: |
|
|
|
 |
|
|
|
|
Private Sub cmdGetSection_Click()
Dim oReg As Registry
Dim astrKeys()As Variant
Dim intLoop As Integer
Set oReg = New Registry
With oReg
.ConfigName = txtConfig
.Section = txtSection
astrKeys = .SectionGet
End With |
|
|
|
|
|